package com.jsu.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.jsu.bean.LostDetail;
import com.jsu.bean.LostExample;
import com.jsu.bean.LostExample.Criteria;
import com.jsu.service.GetMyLostService;
import com.jsu.service.UsrService;

@RestController
public class GetMyLost {

	@Autowired
	LostDetail lostDetail;
	@Autowired
	UsrService usrService;
	@Autowired
	GetMyLostService getMyLostService;
	//查看该用户上传过的寻人
	@RequestMapping(path = {"/getMyLost"})
	@ResponseBody
	public List<LostDetail> getMyLost(HttpServletRequest request){
		String username = request.getParameter("username");
		Integer id = usrService.getIdByName(username);
		List<LostDetail> lostDetails = getMyLostService.getMyLost(id);
		
		return lostDetails;
	}
}
